home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / hcastle.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  16KB  |  447 lines

  1. /***************************************************************************
  2.  
  3.     Haunted Castle
  4.  
  5.     Emulation by Bryan McPhail, mish@tendril.co.uk
  6.  
  7. ***************************************************************************/
  8.  
  9. #include "driver.h"
  10. #include "vidhrdw/generic.h"
  11. #include "cpu/konami/konami.h"
  12. #include "cpu/z80/z80.h"
  13.  
  14. void hcastle_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  15. void hcastle_vh_screenrefresh (struct osd_bitmap *bitmap,int full_refresh);
  16. int hcastle_vh_start (void);
  17. void hcastle_vh_stop (void);
  18.  
  19. extern unsigned char *hcastle_pf1_videoram,*hcastle_pf2_videoram;
  20.  
  21. WRITE_HANDLER( hcastle_pf1_video_w );
  22. WRITE_HANDLER( hcastle_pf2_video_w );
  23. READ_HANDLER( hcastle_gfxbank_r );
  24. WRITE_HANDLER( hcastle_gfxbank_w );
  25. WRITE_HANDLER( hcastle_pf1_control_w );
  26. WRITE_HANDLER( hcastle_pf2_control_w );
  27.  
  28. static WRITE_HANDLER( hcastle_bankswitch_w )
  29. {
  30.     unsigned char *RAM = memory_region(REGION_CPU1);
  31.     int bankaddress;
  32.  
  33.     bankaddress = 0x10000 + (data & 0x1f) * 0x2000;
  34.     cpu_setbank(1,&RAM[bankaddress]);
  35. }
  36.  
  37. static WRITE_HANDLER( hcastle_soundirq_w )
  38. {
  39.     cpu_cause_interrupt( 1, Z80_IRQ_INT );
  40. }
  41.  
  42. static WRITE_HANDLER( hcastle_coin_w )
  43. {
  44.     coin_counter_w(0,data & 0x40);
  45.     coin_counter_w(1,data & 0x80);
  46. }
  47.  
  48. static READ_HANDLER( speedup_r )
  49. {
  50.     unsigned char *RAM = memory_region(REGION_CPU1);
  51.  
  52.     int data = ( RAM[0x18dc] << 8 ) | RAM[0x18dd];
  53.  
  54.     if ( data < memory_region_length(REGION_CPU1) )
  55.     {
  56.         data = ( RAM[data] << 8 ) | RAM[data + 1];
  57.  
  58.         if ( data == 0xffff )
  59.             cpu_spinuntil_int();
  60.     }
  61.  
  62.     return RAM[0x18dc];
  63. }
  64.  
  65.  
  66.  
  67. static struct MemoryReadAddress readmem[] =
  68. {
  69.     { 0x0020, 0x003f, MRA_RAM },
  70.     { 0x0220, 0x023f, MRA_RAM },
  71.     { 0x0410, 0x0410, input_port_0_r },
  72.     { 0x0411, 0x0411, input_port_1_r },
  73.     { 0x0412, 0x0412, input_port_2_r },
  74.     { 0x0413, 0x0413, input_port_5_r }, /* Dip 3 */
  75.     { 0x0414, 0x0414, input_port_4_r }, /* Dip 2 */
  76.     { 0x0415, 0x0415, input_port_3_r }, /* Dip 1 */
  77.     { 0x0418, 0x0418, hcastle_gfxbank_r },
  78.     { 0x0600, 0x06ff, paletteram_r },
  79.     { 0x18dc, 0x18dc, speedup_r },
  80.     { 0x0700, 0x5fff, MRA_RAM },
  81.     { 0x6000, 0x7fff, MRA_BANK1 },
  82.     { 0x8000, 0xffff, MRA_ROM },
  83.     { -1 }    /* end of table */
  84. };
  85.  
  86. static struct MemoryWriteAddress writemem[] =
  87. {
  88.     { 0x0000, 0x0007, hcastle_pf1_control_w },
  89.     { 0x0020, 0x003f, MWA_RAM },    /* rowscroll? */
  90.     { 0x0200, 0x0207, hcastle_pf2_control_w },
  91.     { 0x0220, 0x023f, MWA_RAM },    /* rowscroll? */
  92.     { 0x0400, 0x0400, hcastle_bankswitch_w },
  93.     { 0x0404, 0x0404, soundlatch_w },
  94.     { 0x0408, 0x0408, hcastle_soundirq_w },
  95.     { 0x040c, 0x040c, watchdog_reset_w },
  96.     { 0x0410, 0x0410, hcastle_coin_w },
  97.     { 0x0418, 0x0418, hcastle_gfxbank_w },
  98.     { 0x0600, 0x06ff, paletteram_xBBBBBGGGGGRRRRR_swap_w, &paletteram },
  99.     { 0x0700, 0x1fff, MWA_RAM },
  100.     { 0x2000, 0x2fff, hcastle_pf1_video_w, &hcastle_pf1_videoram },
  101.     { 0x3000, 0x3fff, MWA_RAM, &spriteram, &spriteram_size },
  102.     { 0x4000, 0x4fff, hcastle_pf2_video_w, &hcastle_pf2_videoram },
  103.     { 0x5000, 0x5fff, MWA_RAM, &spriteram_2, &spriteram_2_size },
  104.      { 0x6000, 0xffff, MWA_ROM },
  105.     { -1 }    /* end of table */
  106. };
  107.  
  108. /*****************************************************************************/
  109.  
  110. static WRITE_HANDLER( sound_bank_w )
  111. {
  112.     unsigned char *RAM = memory_region(REGION_SOUND1);
  113.     int bank_A=0x20000 * (data&0x3);
  114.     int bank_B=0x20000 * ((data>>2)&0x3);
  115.  
  116.     K007232_bankswitch(0,RAM+bank_A,RAM+bank_B);
  117. }
  118.  
  119. static struct MemoryReadAddress sound_readmem[] =
  120. {
  121.     { 0x0000, 0x7fff, MRA_ROM },
  122.     { 0x8000, 0x87ff, MRA_RAM },
  123.     { 0xa000, 0xa000, YM3812_status_port_0_r },
  124.     { 0xb000, 0xb00d, K007232_read_port_0_r },
  125.     { 0xd000, 0xd000, soundlatch_r },
  126.     { -1 }    /* end of table */
  127. };
  128.  
  129. static struct MemoryWriteAddress sound_writemem[] =
  130. {
  131.     { 0x0000, 0x7fff, MWA_ROM },
  132.     { 0x8000, 0x87ff, MWA_RAM },
  133.     { 0x9800, 0x987f, K051649_waveform_w },
  134.     { 0x9880, 0x9889, K051649_frequency_w },
  135.     { 0x988a, 0x988e, K051649_volume_w },
  136.     { 0x988f, 0x988f, K051649_keyonoff_w },
  137.     { 0xa000, 0xa000, YM3812_control_port_0_w },
  138.     { 0xa001, 0xa001, YM3812_write_port_0_w },
  139.     { 0xb000, 0xb00d, K007232_write_port_0_w },
  140.     { 0xc000, 0xc000, sound_bank_w }, /* 7232 bankswitch */
  141.     { -1 }    /* end of table */
  142. };
  143.  
  144. /*****************************************************************************/
  145.  
  146. INPUT_PORTS_START( hcastle )
  147.     PORT_START    /* IN0 */
  148.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  149.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  150.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  151.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  152.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  153.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  154.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  155.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  156.  
  157.     PORT_START    /* IN1 */
  158.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  159.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  160.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  161.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  162.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  163.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  164.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  165.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  166.  
  167.     PORT_START    /* IN2 */
  168.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  169.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  170.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  171.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  172.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  173.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  174.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  175.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  176.  
  177.     PORT_START
  178.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
  179.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  180.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  181.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  182.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  183.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  184.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
  185.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  186.     PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  187.     PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) )
  188.     PORT_DIPSETTING(    0x18, "Easy" )
  189.     PORT_DIPSETTING(    0x10, "Normal" )
  190.     PORT_DIPSETTING(    0x08, "Hard" )
  191.     PORT_DIPSETTING(    0x00, "Hardest" )
  192.     PORT_DIPNAME( 0x60, 0x60, "Energy" )
  193.     PORT_DIPSETTING(    0x60, "Strong" )
  194.     PORT_DIPSETTING(    0x40, "Normal" )
  195.     PORT_DIPSETTING(    0x20, "Weak" )
  196.     PORT_DIPSETTING(    0x00, "Very Weak" )
  197.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  198.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  199.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  200.  
  201.     PORT_START
  202.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
  203.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  204.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  205.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  206.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  207.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  208.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  209.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  210.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  211.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  212.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  213.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  214.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  215.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  216.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  217.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  218.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  219.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
  220.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
  221.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
  222.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  223.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
  224.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
  225.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  226.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
  227.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  228.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
  229.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
  230.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
  231.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
  232.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
  233.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
  234.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
  235. //    PORT_DIPSETTING(    0x00, "Invalid" )
  236.  
  237.     PORT_START
  238.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  239.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  240.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  241.     PORT_DIPNAME( 0x02, 0x02, "Upright Controls" )
  242.     PORT_DIPSETTING(    0x02, "Single" )
  243.     PORT_DIPSETTING(    0x00, "Dual" )
  244.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  245.     PORT_DIPNAME( 0x08, 0x08, "Allow Continue" )
  246.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  247.     PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
  248.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  249. INPUT_PORTS_END
  250.  
  251. /*****************************************************************************/
  252.  
  253. static struct GfxLayout charlayout =
  254. {
  255.     8,8,
  256.     32768,
  257.     4,
  258.     { 0, 1, 2, 3 },
  259.     { 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4 },
  260.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  261.     32*8
  262. };
  263.  
  264. static struct GfxDecodeInfo gfxdecodeinfo[] =
  265. {
  266.     { REGION_GFX1, 0, &charlayout,       0, 8*16 },    /* 007121 #0 */
  267.     { REGION_GFX2, 0, &charlayout, 8*16*16, 8*16 },    /* 007121 #1 */
  268.     { -1 } /* end of array */
  269. };
  270.  
  271. /*****************************************************************************/
  272.  
  273. static void irqhandler(int linestate)
  274. {
  275. //    cpu_set_irq_line(1,0,linestate);
  276. }
  277.  
  278. static void volume_callback(int v)
  279. {
  280.     K007232_set_volume(0,0,(v >> 4) * 0x11,0);
  281.     K007232_set_volume(0,1,0,(v & 0x0f) * 0x11);
  282. }
  283.  
  284. static struct K007232_interface k007232_interface =
  285. {
  286.     1,        /* number of chips */
  287.     { REGION_SOUND1 },    /* memory regions */
  288.     { K007232_VOL(44,MIXER_PAN_CENTER,50,MIXER_PAN_CENTER) },    /* volume */
  289.     { volume_callback }    /* external port callback */
  290. };
  291.  
  292. static struct YM3812interface ym3812_interface =
  293. {
  294.     1,
  295.     3579545,
  296.     { 35 },
  297.     { irqhandler },
  298. };
  299.  
  300. static struct k051649_interface k051649_interface =
  301. {
  302.     3579545/2,    /* Clock */
  303.     45,            /* Volume */
  304. };
  305.  
  306. static struct MachineDriver machine_driver_hcastle =
  307. {
  308.     /* basic machine hardware */
  309.     {
  310.          {
  311.             CPU_KONAMI,
  312.             3000000,    /* Derived from 24 MHz clock */
  313.             readmem,writemem,0,0,
  314.             interrupt,1
  315.         },
  316.         {
  317.             CPU_Z80 | CPU_AUDIO_CPU,
  318.             3579545,
  319.             sound_readmem,sound_writemem,0,0,
  320.             ignore_interrupt,0
  321.         }
  322.     },
  323.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  324.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  325.     0,
  326.  
  327.     /* video hardware */
  328.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  329.  
  330.     gfxdecodeinfo,
  331. //    128, 2*8*16*16,    /* the palette only has 128 colors, but need to use 256 to */
  332.     256, 2*8*16*16,    /* use PALETTE_COLOR_TRANSPARENT from the dynamic palette. */
  333.     hcastle_vh_convert_color_prom,
  334.  
  335.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_BUFFERS_SPRITERAM,
  336.     0,
  337.     hcastle_vh_start,
  338.     hcastle_vh_stop,
  339.     hcastle_vh_screenrefresh,
  340.  
  341.     /* sound hardware */
  342.     0,0,0,0,
  343.     {
  344.         {
  345.             SOUND_K007232,
  346.             &k007232_interface,
  347.         },
  348.         {
  349.             SOUND_YM3812,
  350.             &ym3812_interface
  351.         },
  352.         {
  353.             SOUND_K051649,
  354.             &k051649_interface,
  355.         }
  356.     }
  357. };
  358.  
  359. /***************************************************************************/
  360.  
  361. ROM_START( hcastle )
  362.     ROM_REGION( 0x30000, REGION_CPU1 )
  363.     ROM_LOAD( "768.k03",      0x08000, 0x08000, 0x40ce4f38 )
  364.     ROM_LOAD( "768.g06",      0x10000, 0x20000, 0xcdade920 )
  365.  
  366.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  367.     ROM_LOAD( "768.e01",      0x00000, 0x08000, 0xb9fff184 )
  368.  
  369.     ROM_REGION( 0x100000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  370.     ROM_LOAD( "d95.g21",      0x000000, 0x80000, 0xe3be3fdd )
  371.     ROM_LOAD( "d94.g19",      0x080000, 0x80000, 0x9633db8b )
  372.  
  373.     ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  374.     ROM_LOAD( "d91.j5",       0x000000, 0x80000, 0x2960680e )
  375.     ROM_LOAD( "d92.j6",       0x080000, 0x80000, 0x65a2f227 )
  376.  
  377.     ROM_REGION( 0x0500, REGION_PROMS )
  378.     ROM_LOAD( "768c13.j21",   0x0000, 0x0100, 0xf5de80cb )    /* 007121 #0 sprite lookup table */
  379.     ROM_LOAD( "768c14.j22",   0x0100, 0x0100, 0xb32071b7 )    /* 007121 #0 char lookup table */
  380.     ROM_LOAD( "768c11.i4",    0x0200, 0x0100, 0xf5de80cb )    /* 007121 #1 sprite lookup table (same) */
  381.     ROM_LOAD( "768c10.i3",    0x0300, 0x0100, 0xb32071b7 )    /* 007121 #1 char lookup table (same) */
  382.     ROM_LOAD( "768b12.d20",   0x0400, 0x0100, 0x362544b8 )    /* priority encoder (not used) */
  383.  
  384.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* 512k for the samples */
  385.     ROM_LOAD( "d93.e17",      0x00000, 0x80000, 0x01f9889c )
  386. ROM_END
  387.  
  388. ROM_START( hcastlea )
  389.     ROM_REGION( 0x30000, REGION_CPU1 )
  390.     ROM_LOAD( "m03.k12",      0x08000, 0x08000, 0xd85e743d )
  391.     ROM_LOAD( "b06.k8",       0x10000, 0x20000, 0xabd07866 )
  392.  
  393.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  394.     ROM_LOAD( "768.e01",      0x00000, 0x08000, 0xb9fff184 )
  395.  
  396.     ROM_REGION( 0x100000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  397.     ROM_LOAD( "d95.g21",      0x000000, 0x80000, 0xe3be3fdd )
  398.     ROM_LOAD( "d94.g19",      0x080000, 0x80000, 0x9633db8b )
  399.  
  400.     ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  401.     ROM_LOAD( "d91.j5",       0x000000, 0x80000, 0x2960680e )
  402.     ROM_LOAD( "d92.j6",       0x080000, 0x80000, 0x65a2f227 )
  403.  
  404.     ROM_REGION( 0x0500, REGION_PROMS )
  405.     ROM_LOAD( "768c13.j21",   0x0000, 0x0100, 0xf5de80cb )    /* 007121 #0 sprite lookup table */
  406.     ROM_LOAD( "768c14.j22",   0x0100, 0x0100, 0xb32071b7 )    /* 007121 #0 char lookup table */
  407.     ROM_LOAD( "768c11.i4",    0x0200, 0x0100, 0xf5de80cb )    /* 007121 #1 sprite lookup table (same) */
  408.     ROM_LOAD( "768c10.i3",    0x0300, 0x0100, 0xb32071b7 )    /* 007121 #1 char lookup table (same) */
  409.     ROM_LOAD( "768b12.d20",   0x0400, 0x0100, 0x362544b8 )    /* priority encoder (not used) */
  410.  
  411.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* 512k for the samples */
  412.     ROM_LOAD( "d93.e17",      0x00000, 0x80000, 0x01f9889c )
  413. ROM_END
  414.  
  415. ROM_START( hcastlej )
  416.     ROM_REGION( 0x30000, REGION_CPU1 )
  417.     ROM_LOAD( "768p03.k12",0x08000, 0x08000, 0xd509e340 )
  418.     ROM_LOAD( "768j06.k8", 0x10000, 0x20000, 0x42283c3e )
  419.  
  420.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  421.     ROM_LOAD( "768.e01",   0x00000, 0x08000, 0xb9fff184 )
  422.  
  423.     ROM_REGION( 0x100000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  424.     ROM_LOAD( "d95.g21",      0x000000, 0x80000, 0xe3be3fdd )
  425.     ROM_LOAD( "d94.g19",      0x080000, 0x80000, 0x9633db8b )
  426.  
  427.     ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  428.     ROM_LOAD( "d91.j5",       0x000000, 0x80000, 0x2960680e )
  429.     ROM_LOAD( "d92.j6",       0x080000, 0x80000, 0x65a2f227 )
  430.  
  431.     ROM_REGION( 0x0500, REGION_PROMS )
  432.     ROM_LOAD( "768c13.j21",   0x0000, 0x0100, 0xf5de80cb )    /* 007121 #0 sprite lookup table */
  433.     ROM_LOAD( "768c14.j22",   0x0100, 0x0100, 0xb32071b7 )    /* 007121 #0 char lookup table */
  434.     ROM_LOAD( "768c11.i4",    0x0200, 0x0100, 0xf5de80cb )    /* 007121 #1 sprite lookup table (same) */
  435.     ROM_LOAD( "768c10.i3",    0x0300, 0x0100, 0xb32071b7 )    /* 007121 #1 char lookup table (same) */
  436.     ROM_LOAD( "768b12.d20",   0x0400, 0x0100, 0x362544b8 )    /* priority encoder (not used) */
  437.  
  438.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* 512k for the samples */
  439.     ROM_LOAD( "d93.e17",  0x00000, 0x80000, 0x01f9889c )
  440. ROM_END
  441.  
  442.  
  443.  
  444. GAMEX( 1988, hcastle,  0,       hcastle, hcastle, 0, ROT0, "Konami", "Haunted Castle (set 1)", GAME_NO_COCKTAIL )
  445. GAMEX( 1988, hcastlea, hcastle, hcastle, hcastle, 0, ROT0, "Konami", "Haunted Castle (set 2)", GAME_NO_COCKTAIL )
  446. GAMEX( 1988, hcastlej, hcastle, hcastle, hcastle, 0, ROT0, "Konami", "Akuma-Jou Dracula (Japan)", GAME_NO_COCKTAIL )
  447.